package com.kai.steering.data.service.service;

import com.kai.steering.common.vo.Result;
import com.kai.steering.data.service.entity.domainObject.QuestionDO;
import com.kai.steering.data.service.entity.dto.QuestionQueryDTO;
import com.kai.steering.data.service.entity.po.Question;
import com.kai.steering.common.web.service.BaseService;
import com.kai.steering.common.vo.Page;
import com.kai.steering.data.service.entity.vo.QuestionVO;
import com.kai.steering.exception.ExcelException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * <pre>
 * 题目 服务类
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
public interface QuestionService extends BaseService<Question> {

    /**
     * 保存
     *
     * @param questionDO
     * @return
     */
    QuestionDO saveQuestion(QuestionDO questionDO);

    /**
     * 修改
     *
     * @param questionDO
     * @return
     */
    boolean updateQuestion(Serializable id, QuestionDO questionDO);

    /**
     * 删除
     *
     * @param id
     * @return
     */
    boolean deleteQuestion(Serializable id);
    /**
     * 根据ID获取查询对象——自身
     *
     * @param questionId
     * @return
     */
    QuestionDO getQuestionById(Serializable questionId,HashMap<String,Boolean> parameterMap);

    /**
     * 根据ID获取查询对象——全属性
     *
     * @param questionId
     * @return
     */
    QuestionDO getQuestionById_All(Serializable questionId);

    /**
     * 根据ID获取查询对象——视图
     * 题目、分类、知识点、用户与题目
     * @param questionId
     * @return
     */
    QuestionDO getQuestionById_VO(Serializable questionId);
    /**
     * 获取所有对象
     *
     * @return
     */
    List<QuestionVO> getAllQuestion();

    /**
     * 获取分页对象
     *
     * @param questionQueryDTO
     * @return
     */
    Page<QuestionVO> getQuestionPageList(QuestionQueryDTO questionQueryDTO);

    /**
     * 判断某属性是否存在
     *
     * @param key
     * @param val
     * @param id
     * @return
     */
    boolean isExists(String key, String val, Serializable id);


    public List<QuestionDO> getQuestionByIds(List<String> collect, HashMap<String,Boolean> parameterMap) ;
    /**
     * 导出
     * @param questionIds
     * @return
     */
    boolean exportQuestion(List<String> questionIds);

    /**
     * 导入
     * @param file
     * @return
     */
    List<ExcelException> importQuestion(MultipartFile file,int page,int line);


    /**
     * list转换为实体
     * @param surface
     * @return
     */
    ArrayList<QuestionDO> tableConversionQuestionDO(List<List> surface);

    /**
     * 保存多个实体
     * @param questionDOs
     * @return
     */
    public List<ExcelException> saveQuestionAll(List<QuestionDO> questionDOs);

    List<QuestionDO> getTestquestion(Serializable id, HashMap<String,Boolean> parameterMap);

    Boolean questionService(String id,String result);

     Boolean correctJudgment(String questionId, String answerId, String result);
}

